package cn.edu.fzu.homemaking.api;

import cn.edu.fzu.homemaking.domain.enums.CommentStatusEnum;
import cn.edu.fzu.homemaking.domain.enums.OrderStatusEnum;
import cn.edu.fzu.homemaking.web.Result;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;

/**
 * @Author jiebin
 * @Date 2023/4/11
 */
@FeignClient(name="order")
public interface OrderApi {

    @PostMapping("/api/order/auth/insert")
    public Result insert(@RequestParam("companyId") Long companyId,@RequestParam("userId") Long userId,
                         @RequestParam("demandId") Long demandId, @RequestParam("serverId") Long serverId,
                         @RequestParam("description") String description, @RequestParam("customerName") String customerName,
                         @RequestParam("address") String address, @RequestParam("phone") String phone,
                         @RequestParam("email") String email, @RequestParam("startTime") String startTime,
                         @RequestParam("price") BigDecimal price, @RequestParam("qty") Integer qty);

    @PostMapping("/api/order/auth/updateStatus")
    public Result updateStatus(@RequestParam("orderId") String orderId, @RequestParam("status") OrderStatusEnum status);

    @PostMapping("/api/order/auth/updateCommentStatus")
    public Result updateCommentStatus(@RequestParam("orderId") String orderId,
                                      @RequestParam("status") CommentStatusEnum status);

    @GetMapping("/api/order/auth/list")
    public Result list(@RequestParam("companyId") Long companyId,@RequestParam("demandId") Long demandId,
                       @RequestParam("serverId") Long serverId, @RequestParam("startTime") String startTime,
                       @RequestParam("endTime") String endTime, @RequestParam("status") OrderStatusEnum status,
                       @RequestParam("commentStatus") CommentStatusEnum commentStatus,
                       @RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize);

    @GetMapping("/api/order/auth/selectByOrderId")
    public Result selectByOrderId(@RequestParam("orderId") String orderId);

    @GetMapping("/api/order/auth/getUnPayMoney")
    public Result getUnPayMoney();
}
